home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tclx / TclX.man < prev   
Encoding:
Text File  |  1992-04-07  |  50.9 KB  |  1,255 lines

  1.  
  2.  
  3.  
  4. TclX                 UNKNOWN MANUAL SECTION                  TclX
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      TclX - Extended Tcl - Extended command set for Tcl 6.1.
  10.  
  11. IINNTTRROODDUUCCTTIIOONN
  12.      This man page contains the  documentation  for  all  of  the
  13.      extensions that are added to Tcl 6.1 by Extended Tcl.  These
  14.      extensions provide their capabilities by adding new commands
  15.      to   Tcl  whitout  changing  the  syntax  of  standard  Tcl.
  16.      Extended Tcl is a superset of standard Tcl and is built with
  17.      the standard Tcl sources.
  18.  
  19.      The command descriptions are separated into several sections:
  20.  
  21.      o General Commands
  22.  
  23.      o Unix Access Commands
  24.  
  25.      o File I/O Commands
  26.  
  27.      o File Scanning Commands
  28.  
  29.      o Math Commands
  30.  
  31.      o List Manipulation Commands
  32.  
  33.      o Keyed Lists
  34.  
  35.      o String and Character Manipulation Commands
  36.  
  37. GGEENNEERRAALL CCOOMMMMAANNDDSS
  38.      A set of general useful Tcl commands.  Includes  interactive
  39.      inputting  of commands, a facility for tracing execution and
  40.      a looping command.
  41.  
  42.      ccoommmmaannddlloooopp [[_p_r_o_m_p_t] [_p_r_o_m_p_t_2]
  43.           Create an interactive command loop for the current  TCL
  44.           interpreter.  This command receives commands from stdin
  45.           and executes them.  This command  is  useful  for  non-
  46.           interactive  TCL scripts that want to enter an interac-
  47.           tive mode.  _P_r_o_m_p_t is a command string to set  the  top
  48.           level prompt hook to
  49.            to, the contents of which is executed to generate  the
  50.           main  prompt.   _P_r_o_m_p_t_2  is a command string to set the
  51.           down level prompt to, which  is  generates  the  prompt
  52.           command  for continuation input.  When the command ter-
  53.           minates, the variables for the prompt hooks will be set
  54.           to  their old value.  If these arguments are not speci-
  55.           fied, the prompt hooks use their current value.  Prompt
  56.           hooks  are  TCL  code  that  return as their result the
  57.           prompt to output.  The result of the last command  exe-
  58.           cuted  in  the  command  string (which may be a rreettuurrnn)
  59.           will be outputted as the prompt.
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TclX                 UNKNOWN MANUAL SECTION                  TclX
  71.  
  72.  
  73.  
  74.      ccmmddttrraaccee _l_e_v_e_l|oonn [nnooeevvaall] [nnoottrruunnccaattee] [fflluusshh] [_f_i_l_e_h_a_n_d_l_e]
  75.           Print a trace statement for all  commands  executed  at
  76.           depth of _l_e_v_e_l or below (1 is the top level).  If oonn is
  77.           specified, all commands at any level  are  traced.   If
  78.           nnooeevvaall  is specified, arguments are printed unevaluated
  79.           -- if it is not specified, the  arguments  are  printed
  80.           after evaluation. If the command line is longer than 60
  81.           characters, it is truncated to 60 and a "..." is  post-
  82.           pended  to  indicate  that  there  was more.  If nnooeevvaall
  83.           wasn't  specified,  the  arguments  are  printed  after
  84.           evaluation.   In  this case, each argument is truncated
  85.           to 40 characters (with "..." postpended if the argument
  86.           was  longer  than  40  characters)  and  printed. If an
  87.           evaluated argument contains a space, the  entire  argu-
  88.           ment  will be enclosed inside of braces (`{}') to allow
  89.           the reader to visually separate the arguments from each
  90.           other.  If nnoottrruunnccaattee is specified, then the truncation
  91.           of commands and evaluated arguments will  be  disabled.
  92.           If  fflluusshh  is specified, then the output buffer will be
  93.           flushed after each line is  printed.   This  is  useful
  94.           when  tracing  code that cause an application to abort,
  95.           making it easy to narrow the problem down to  the  com-
  96.           mand that caused the abort. If _f_i_l_e_h_a_n_d_l_e is specified,
  97.           then the trace output will be written to the file.
  98.  
  99.      ccmmddttrraaccee ooffff
  100.           Turn off all tracing.
  101.  
  102.      ccmmddttrraaccee ddeepptthh
  103.           Returns the current maximum trace  level,  or  zero  if
  104.           trace is disabled.
  105.  
  106.      eecchhoo _s_t_r_1 [_s_t_r_2..]
  107.           Print the strings to stdout followed by a newline.
  108.  
  109.      iinnffooxx _o_p_t_i_o_n
  110.           Return information about extended Tcl  or  the  current
  111.           application.  The  following  iinnffooxx command options are
  112.           available.
  113.  
  114.           vveerrssiioonn
  115.                Return the version number of  Extended  Tcl.   The
  116.                version  number  for  extended Tcl is generated by
  117.                combining the base version  of  the  standard  Tcl
  118.                code  with  a  letter  indicating  the  version of
  119.                Extended Tcl being used.  This is  the  documenta-
  120.                tion for version ttccll66..11aa.
  121.  
  122.           ppaattcchhlleevveell
  123.                Return the patchlevel for Extended Tcl.
  124.  
  125.           aappppnnaammee
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TclX                 UNKNOWN MANUAL SECTION                  TclX
  137.  
  138.  
  139.  
  140.                Return  the  symbolic  application  name  of   the
  141.                current  application  linked with the Extended Tcl
  142.                library.  The C variable ttccllAAppppNNaammee must be set by
  143.                the  application to return an application specific
  144.                value for this variable.
  145.  
  146.           aapppplloonnggnnaammee
  147.                Return a natural language  name  for  the  current
  148.                application. The C variable ttccllLLoonnggAAppppNNaammee must be
  149.                set by the application to  return  an  application
  150.                specific value for this variable.
  151.  
  152.           aappppvveerrssiioonn
  153.                Return the version number for the current applica-
  154.                tion.  The C variable ttccllAAppppVVeerrssiioonn must be set by
  155.                the application to return an application  specific
  156.                value for this variable.
  157.  
  158.      lloooopp _v_a_r _f_i_r_s_t _l_a_s_t [_i_n_c_r_e_m_e_n_t] _b_o_d_y
  159.           LLoooopp is a looping command, similar in behavior  to  the
  160.           Tcl  ffoorr  statement,  except  that  the  lloooopp statement
  161.           achieves substantially higher performance and is easier
  162.           to  code when the beginning and ending values of a loop
  163.           are known and the loop variable is to be incremented by
  164.           a known, fixed amount every time through.
  165.  
  166.            The _v_a_r argument is the name of a  Tcl  variable  that
  167.           will  contain  the loop index.  The loop index is first
  168.           set to the value specified by _f_i_r_s_t.   The  Tcl  inter-
  169.           preter  is  invoked upon _b_o_d_y zero or more times, where
  170.           _v_a_r is incremented by _i_n_c_r_e_m_e_n_t every time through  the
  171.           loop,  or by one if _i_n_c_r_e_m_e_n_t is not specified.  _I_n_c_r_e_-
  172.           _m_e_n_t can be negative in which case the loop will  count
  173.           downwards.
  174.  
  175.           When _v_a_r reaches _l_a_s_t, the loop  terminates  without  a
  176.           subsequent  execution  of  _b_o_d_y.   For instance, if the
  177.           original lloooopp parameters would cause lloooopp to terminate,
  178.           say  _f_i_r_s_t was one, _l_a_s_t was zero and _i_n_c_r_e_m_e_n_t was not
  179.           specified or was non-negative, _b_o_d_y is not executed  at
  180.           all and lloooopp returns.
  181.  
  182.           If a ccoonnttiinnuuee command is invoked within _b_o_d_y  then  any
  183.           remaining commands in the current execution of _b_o_d_y are
  184.           skipped, as in the ffoorr command.  If a bbrreeaakk command  is
  185.           invoked  within  _b_o_d_y then the lloooopp command will return
  186.           immediately.  LLoooopp returns an empty string.
  187.  
  188. UUNNIIXX AACCCCEESSSS CCOOMMMMAANNDDSS
  189.      These commands provide access to many basic Unix facilities,
  190.      including  process handling, data and time, signal handling,
  191.      linking  and  unlinking  files,  changing  file  attributes,
  192.  
  193.  
  194.  
  195. Tcl                                                             3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. TclX                 UNKNOWN MANUAL SECTION                  TclX
  203.  
  204.  
  205.  
  206.      process  and  user attributes and the executing commands via
  207.      the shell.
  208.  
  209.      aallaarrmm _s_e_c_o_n_d_s
  210.           Instructs the system to send a SIGALRM  signal  in  the
  211.           specified number of seconds.  If _s_e_c_o_n_d_s is 0, any pre-
  212.           vious alarm request is canceled.  Only one alarm  at  a
  213.           time  may  be active, the command returns the number of
  214.           seconds left in the previous alarm.
  215.  
  216.      cchhggrrpp _g_r_o_u_p _f_i_l_e_l_i_s_t
  217.           Set group of each file in the list _f_i_l_e_l_i_s_t  to  _g_r_o_u_p,
  218.           which is a group name or numeric group id.
  219.  
  220.      cchhmmoodd [[--ii] _m_o_d_e _f_i_l_e_l_i_s_t
  221.           Set permissions of each of the files in the list _f_i_l_e_l_-
  222.           _i_s_t  to _m_o_d_e, which is an absolute numeric mode or sym-
  223.           bolic permissions as  in  the  cchhmmoodd((CC))  UNIX  command.
  224.           Normally  absolute modes are assumed to be specified in
  225.           octal.   However  Tcl  stores  numbers  internally   as
  226.           integers.   The --ii option causes an absolute mode to be
  227.           treated as a standard Tcl integer (decimal unless  pre-
  228.           fixed by "0" of "0x").
  229.  
  230.      cchhoowwnn _o_w_n_e_r|{_o_w_n_e_r _g_r_o_u_p} _f_i_l_e_l_i_s_t
  231.           Set owner of each file in the list _f_i_l_e_l_i_s_t  to  _o_w_n_e_r,
  232.           which  is  a  owner  name  or numeric owner id.  If the
  233.           first parameter is a list, then the owner is set to the
  234.           first  element  of the list and the group is set to the
  235.           second element of the list. _G_r_o_u_p is a  group  name  or
  236.           numeric  group id.  If _g_r_o_u_p is {}, then the file group
  237.           will be set to the group for the associated the  speci-
  238.           fied user.
  239.  
  240.      eexxeeccvvpp _p_r_o_g [_a_r_g_1..._a_r_g_N]
  241.           Do an execvp, replacing the current program  with  _p_r_o_g
  242.           and passing the arguments _a_r_g_1..._a_r_g_N.
  243.  
  244.      ffmmttcclloocckk _c_l_o_c_k_v_a_l [_f_o_r_m_a_t] [GGMMTT||{{}}]
  245.           Convert a value returned by ggeettcclloocckk or ffiillee  to  human
  246.           readable  form.   The  _f_o_r_m_a_t argument is a string that
  247.           describes how to  format  the  date  and  time.   Field
  248.           descriptors  consist  of  a  ``%''  followed by a field
  249.           descriptor. All other characters are  copied  into  the
  250.           result.  The available field descriptors are:
  251.  
  252.               %% - Insert a %.
  253.               %a - Abbreviated weekday name.
  254.               %A - Full weekday name
  255.               %b - Abbreviated month name.
  256.               %B - Full month name.
  257.               %d - Day of month (01 - 31).
  258.  
  259.  
  260.  
  261. Tcl                                                             4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. TclX                 UNKNOWN MANUAL SECTION                  TclX
  269.  
  270.  
  271.  
  272.               %D - Date as %m/%d/%y.
  273.               %e - Day of month (1-31), no leading zeros.
  274.               %h - Abbreviated month name.
  275.               %H - Hour (00 - 23).
  276.               %I - Hour (00 - 12).
  277.               %j - Day number of year (001 - 366).
  278.               %m - Month number (01 - 12).
  279.               %M - Minute (00 - 59).
  280.               %n - Insert a new line.
  281.               %p - AM or PM.
  282.               %r - Time as %I:%M:%S %p.
  283.               %R - Time as %H:%M.
  284.               %S - Seconds (00 - 59).
  285.               %t - Insert a tab.
  286.               %T - Time as %H:%M:%S.
  287.               %U - Week number of year (01 - 52), Sunday is the first
  288.                    day of the week.
  289.               %w - Weekday number (Sunday = 0).
  290.               %W - Week number of year (01 - 52), Monday is the first
  291.                    day of the week.
  292.               %x - Local specific date format.
  293.               %X - Local specific time format.
  294.               %y - Year within century (00 - 99).
  295.               %Y - Year as ccyy (e.g. 1990)
  296.               %Z - Time zone name.
  297.  
  298.           If format is not specified, "%a %b %d %H:%M:%S  %Z  %Y"
  299.           is  used.   If  GGMMTT is specified, the time will be for-
  300.           mated as Greenwich Mean Time. If the  argument  is  not
  301.           specified  or is empty, then the local timezone will be
  302.           used as defined by the timezone environment variable.
  303.  
  304.      ffoorrkk
  305.           Fork the current TCL process.  Fork returns zero to the
  306.           child  process  and  the process number of the child to
  307.           the parent process.  If an eexxeeccvvpp is not  going  to  be
  308.           performed before the forked process does output, then a
  309.           fflluusshh should be issued against ssttddoouutt, ssttddeerrrr  and  any
  310.           other  open  output file before doing the ffoorrkk.  Other-
  311.           wise, output from the parent  process  pending  in  the
  312.           buffers will also be outputted by the child process.
  313.  
  314.      ggeettcclloocckk
  315.           Return the current date and time as a system  dependent
  316.           integer  value.   The  unit  of  the  value is seconds,
  317.           allowing it to be used for relative  time  calculations
  318.           and so forth.
  319.  
  320.      iidd ooppttiioonnss
  321.           This command provides a means of getting,  setting  and
  322.           converting  user, group and process ids.  The following
  323.           versions of the iidd command are available:
  324.  
  325.  
  326.  
  327. Tcl                                                             5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. TclX                 UNKNOWN MANUAL SECTION                  TclX
  335.  
  336.  
  337.  
  338.           iidd uusseerr [_n_a_m_e]
  339.  
  340.           iidd uusseerriidd [_u_i_d]
  341.                Set the real and effective user ID to _n_a_m_e or _u_i_d,
  342.                if  the  name  (or  uid)  is valid and permissions
  343.                allow it.  If the name (or uid) is not  specified,
  344.                the current name (or uid) is returned.
  345.  
  346.           iidd ccoonnvveerrtt uusseerriidd _u_i_d
  347.  
  348.           iidd ccoonnvveerrtt uusseerr _n_a_m_e
  349.                Convert a user ID number to a user name,  or  vice
  350.                versa.
  351.  
  352.           iidd ggrroouupp [_n_a_m_e]
  353.  
  354.           iidd ggrroouuppiidd [_g_i_d]
  355.                Set the real and effective group  ID  to  _n_a_m_e  or
  356.                _g_i_d, if the name (or gid) is valid and permissions
  357.                allow it.  If the  group  name  (or  gid)  is  not
  358.                specified,  the  current  group  name  (or gid) is
  359.                returned.
  360.  
  361.           iidd ccoonnvveerrtt ggrroouuppiidd _g_i_d
  362.  
  363.           iidd ccoonnvveerrtt ggrroouupp _n_a_m_e
  364.                Convert a group ID number to a group name, or vice
  365.                versa.
  366.  
  367.           iidd eeffffeeccttiivvee uusseerr
  368.  
  369.           iidd eeffffeeccttiivvee uusseerriidd
  370.                Return the effective user name, or effective  user
  371.                ID number, respectively.
  372.  
  373.           iidd eeffffeeccttiivvee ggrroouupp
  374.  
  375.           iidd eeffffeeccttiivvee ggrroouuppiidd
  376.                Return the  effective  group  name,  or  effective
  377.                group ID number, respectively.
  378.  
  379.           iidd pprroocceessss
  380.                Return the process ID of the current process.
  381.  
  382.           iidd pprroocceessss ppaarreenntt
  383.                Return the process ID of the parent of the current
  384.                process.
  385.  
  386.           iidd pprroocceessss ggrroouupp
  387.                Return the process group ID of  the  current  pro-
  388.                cess.
  389.  
  390.  
  391.  
  392.  
  393. Tcl                                                             6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. TclX                 UNKNOWN MANUAL SECTION                  TclX
  401.  
  402.  
  403.  
  404.           iidd pprroocceessss ggrroouupp sseett
  405.                Set the process group ID of the current process to
  406.                its process ID.
  407.  
  408.      kkiillll [[_s_i_g_n_a_l] _p_r_o_c_e_s_s_l_i_s_t
  409.           Send a signal to the each  process  in  the  list  _p_r_o_-
  410.           _c_e_s_s_l_i_s_t,  if  permitted.   _S_i_g_n_a_l,  if present, is the
  411.           signal number or the symbolic name of the  signal,  see
  412.           the  signal system call manual page.  The leading "SIG"
  413.           is optional when the signal is specified  by  its  sym-
  414.           bolic name.
  415.  
  416.      The default for _s_i_g_n_o is 15, SIGTERM.
  417.  
  418.      lliinnkk _s_r_c_p_a_t_h _d_e_s_t_p_a_t_h
  419.           Create a directory entry, _d_e_s_t_p_a_t_h, linking it  to  the
  420.           existing file, _s_r_c_p_a_t_h.
  421.  
  422.      mmkkddiirr [[--ppaatthh]] _d_i_r_L_i_s_t
  423.           Create each of the directories  in  the  list  _d_i_r_L_i_s_t.
  424.           The mode on the new directories is 777, modified by the
  425.           umask.  If --ppaatthh is specified,  then  any  non-existent
  426.           parent  directories  in  the  specified  path  are also
  427.           created.
  428.  
  429.      rrmmddiirr _d_i_r_L_i_s_t
  430.           Remove each of the directories in the list _d_i_r_L_i_s_t.
  431.  
  432.      ssiiggnnaall _a_c_t_i_o_n _s_i_g_l_i_s_t [_c_o_m_m_a_n_d]
  433.           Specify the action to take when a Unix  signal  occurs.
  434.           _S_i_g_l_i_s_t  is  a  list  of either the symbolic or numeric
  435.           Unix signal (the SIG prefix is  optional).   _A_c_t_i_o_n  is
  436.           one of the following actions to be performed on receipt
  437.           of the signal.
  438.  
  439.           ddeeffaauulltt - Terminate the process
  440.  
  441.           iiggnnoorree - Ignore the signal.
  442.  
  443.           eerrrroorr - Generate a catchable Tcl error.  It will be  as
  444.           if the command that was running returned an error.  The
  445.           error code will be in the form:
  446.               {UUNNIIXX SSIIGG _s_i_g_n_a_m_e}
  447.           For the death of child signal, _s_i_g_n_a_m_e will  always  be
  448.           SIGCHLD, rather than SIGCLD, to allow writting protable
  449.           code.
  450.  
  451.           ttrraapp - When the signal  occures,  execute  _c_o_m_m_a_n_d  and
  452.           continue  execution if an error is not returned by _c_o_m_-
  453.           _m_a_n_d.  If will be executed in the  global  context  and
  454.           the symbolic signal name (e.g. SIGINT) will be supplied
  455.           in a global variable ssiiggnnaallRReecciieevveedd.  If  an  error  is
  456.  
  457.  
  458.  
  459. Tcl                                                             7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. TclX                 UNKNOWN MANUAL SECTION                  TclX
  467.  
  468.  
  469.  
  470.           returned, then follow the standard Tcl error mechanism.
  471.           Often _c_o_m_m_a_n_d will just do an eexxiitt.
  472.  
  473.           ggeett - Retrieve the current settings  of  the  specified
  474.           signals.   A  list  will  be returned with each element
  475.           containing  one  of  `ddeeffaauulltt',  `iiggnnoorree',  `eerrrroorr'  or
  476.           `ttrraapp' corresponding to each signal in _s_i_g_l_i_s_t.
  477.  
  478.           For all signals except SSIIGGCCLLDD, the signal  action  will
  479.           remain  enabled after the specified signal has occured.
  480.           For SSIIGGCCLLDD (also known as SSIIGGCCHHLLDD), the signal will not
  481.           be  automatically  reenable.  A  wait must be performed
  482.           before issuing another ssiiggnnaall command.  Signals are not
  483.           processed until after the completion of the Tcl command
  484.           that is executing when the signal is recieved.
  485.  
  486.      sslleeeepp _s_e_c_o_n_d_s
  487.           Sleep the TCL process for _s_e_c_o_n_d_s.
  488.  
  489.      ssyysstteemm _c_o_m_m_a_n_d
  490.           Executes _c_o_m_m_a_n_d via the system(3) call.  Differs  from
  491.           eexxeecc because ssyysstteemm doesn't return stdout as the result
  492.           or the command and ssyysstteemm goes  through  the  shell  to
  493.           provide  wildcard  expansion,  redirection,  etc, as is
  494.           normal from a sshh command line.  Returns the  exit  code
  495.           of the command.
  496.  
  497.      ttiimmeess
  498.           Return a list containing the process and  child  execu-
  499.           tion times in the form:
  500.               _u_t_i_m_e _s_t_i_m_e _c_u_t_i_m_e _c_s_t_i_m_e
  501.           See times system call manual page.  The values  are  in
  502.           milliseconds.
  503.  
  504.      uummaasskk [[_o_c_t_a_l_m_a_s_k]
  505.           Sets file-creation mode mask  to  the  octal  value  of
  506.           _o_c_t_a_l_m_a_s_k.   If  _o_c_t_a_l_m_a_s_k is omitted, the current mask
  507.           is returned.
  508.  
  509.      uunnlliinnkk _f_i_l_e_l_i_s_t
  510.           Delete (unlink) the files whose names are in  the  list
  511.           _f_i_l_e_l_i_s_t.
  512.  
  513.      wwaaiitt _p_r_o_c_l_i_s_t
  514.           Waits for an  any  of  the  immediate  child  processes
  515.           specified in the list _p_r_o_c_l_i_s_t to terminate or a signal
  516.           to be received.  WWaaiitt returns a list of three elements:
  517.           The first element is process id of the terminating pro-
  518.           cess. If the process exited normally, the  second  ele-
  519.           ment  is  `EXIT',  followed  by the error code.  If the
  520.           process terminated because of a signal, the second ele-
  521.           ment  is  `SIG',  followed  by the signal name.  If the
  522.  
  523.  
  524.  
  525. Tcl                                                             8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. TclX                 UNKNOWN MANUAL SECTION                  TclX
  533.  
  534.  
  535.  
  536.           process is currently stopped,  the  second  element  is
  537.           `STOP', followed by the signal name.
  538.  
  539. FFIILLEE II//OO CCOOMMMMAANNDDSS
  540.      The commands extend the stdio-style  file  I/O  capabilities
  541.      present  in  Tcl  6.1.   These  extensions include searching
  542.      ASCII-sorted data files,  copying  files,  duplicating  file
  543.      descriptors, control of file access options, retrieving open
  544.      file status, and creating pipes with the ppiippee system call. A
  545.      interface  to  the  sseelleecctt  system call is also available on
  546.      Unix systems that support it.
  547.  
  548.      It should be noted that Tcl file I/O is implemented  on  top
  549.      of  the  stdio  library.   By default, the file is buffered,
  550.      when communicating to a process through a pipe, a fflluusshh com-
  551.      mand should be issued to force the data out.  Alternatively,
  552.      the ffccnnttll command may be used to set the buffering  mode  to
  553.      line buffered or unbuffered.
  554.  
  555.      bbsseeaarrcchh _f_i_l_e_h_a_n_d_l_e _k_e_y [_r_e_t_v_a_r] [_c_o_m_p_a_r_e__p_r_o_c]
  556.           Search an opened sorted data file,  _f_i_l_e_h_a_n_d_l_e,  for  a
  557.           line  matching  _k_e_y.  If  _r_e_t_v_a_r is specified, then the
  558.           line from the file is returned in _r_e_t_v_a_r and  the  com-
  559.           mand  returns  11  if _k_e_y was found, and 00 if it was not
  560.           found.  If _r_e_t_v_a_r is not specified or is a  null  name,
  561.           then the command returns the line that was found, or an
  562.           empty string if _k_e_y is not found.
  563.  
  564.           By default,  the  key  is  matched  against  the  first
  565.           white-space seperated field in each line.  The field is
  566.           treated as an ASCII string.  If _c_o_m_p_a_r_e__p_r_o_c is  speci-
  567.           fied,  then it is the name of a Tcl procedure to evalu-
  568.           ate  against  each  line  read  from  the  file.   This
  569.           _c_o_m_p_a_r_e__p_r_o_c  takes  two  arguments, the key and a line
  570.           extracted from the file.  The  compare  routine  should
  571.           return  a number less than zero if the key is less than
  572.           the line, zero if the key matches the line  or  greater
  573.           than  zero  if  the  key is greater than the line.  The
  574.           file must be sorted in assending order by whatever cri-
  575.           teria  _c_o_m_p_a_r_e__p_r_o_c  uses  to  compare the key with the
  576.           line.
  577.  
  578.      ccooppyyffiillee _h_a_n_d_l_e_1 _h_a_n_d_l_e_2
  579.           Copies the rest of file specified by _h_a_n_d_l_e_1  from  its
  580.           current position to the file specified by _h_a_n_d_l_e_2.
  581.  
  582.      dduupp _f_i_l_e_h_a_n_d_l_e [_s_t_d_h_a_n_d_l_e]
  583.           Duplicate an open file.  A file handle is created  that
  584.           addresses the same file as _f_i_l_e_h_a_n_d_l_e.
  585.  
  586.           A special case is allowed for dup-ing files  to  stdin,
  587.           stdout  or  stderr.  If _s_t_d_h_a_n_d_l_e is specified, then it
  588.  
  589.  
  590.  
  591. Tcl                                                             9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. TclX                 UNKNOWN MANUAL SECTION                  TclX
  599.  
  600.  
  601.  
  602.           must be one of the standard handles to  dup  _f_i_l_e_h_a_n_d_l_e
  603.           to.
  604.  
  605.               proc ChildProcess {cmd inPipe outPipe} {
  606.                   if {[set childPid [fork]] == 0} {
  607.                       close stdin
  608.                       dup $inPipe stdin
  609.                       close $inPipe
  610.  
  611.                       close stdout
  612.                       dup $outPipe stdout
  613.                       close $outPipe
  614.  
  615.                       execvp $cmd
  616.                       # will never make it here...
  617.                   }
  618.                   return $childPid
  619.               }
  620.  
  621.      ffccnnttll _h_a_n_d_l_e [_a_t_t_r_i_b_u_t_e _v_a_l_u_e]
  622.           This command either returns a list of  various  boolean
  623.           attributes  controlling  access  to  a  file  or set or
  624.           clears one of the boolean attributes.  If _a_t_t_r_i_b_u_t_e and
  625.           _v_a_l_u_e  are  not  specified, then the list of the attri-
  626.           butes that are set are return. If an attribute  is  not
  627.           set,  then  it  will  not be included in the list.  The
  628.           following attributes maybe returned:
  629.  
  630.           RRDDOONNLLYY - The file is opened for reading only.
  631.  
  632.           WWRROONNLLYY - The file is opened for writing only.
  633.  
  634.           RRDDWWRR - The file is opened for reading and writing.
  635.  
  636.           AAPPPPEENNDD - The file is opened  for  append  only  writes.
  637.           All writes will be forced to the end of the file.
  638.  
  639.           NNDDEELLAAYY - The file is to be accessed  with  non-blocking
  640.           I/O.  See the rreeaadd system call for a description of how
  641.           it affects the behaviour of file reads
  642.  
  643.           CCLLEEXXEECC - Close the file on an  process  exec.   If  the
  644.           eexxeeccvvpp  command or some other mechanism causes the pro-
  645.           cess to exec, the file will be closed.
  646.  
  647.           NNOOBBUUFF - The file is not buffered. If set, then there no
  648.           stdio buffering for the file.
  649.  
  650.           LLIINNEEBBUUFF - Output the file will be  line  buffered.  The
  651.           buffer  will be flushed when a newline is written, when
  652.           the buffer is full, or when input is requested.
  653.  
  654.  
  655.  
  656.  
  657. Tcl                                                            10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. TclX                 UNKNOWN MANUAL SECTION                  TclX
  665.  
  666.  
  667.  
  668.           The AAPPPPEENNDD, NNDDEELLAAYY, and CCLLEEXXEECC attributes may be set or
  669.           cleared  by specifying the attribute name and a value 11
  670.           to set the attribute and 00 to clear it.
  671.  
  672.           The NNOOBBUUFF and LLIINNEEBBUUFF attributes may  only  be  set  (a
  673.           value  of  11)  and  only one of the options may be set.
  674.           Once set, they may not be cleared. Thees option  should
  675.           be  set before any I/O operations have been done on the
  676.           file.
  677.  
  678.      ffssttaatt _h_a_n_d_l_e [_a_r_r_a_y_v_a_r]
  679.           Obtain the status of an open file.  This  differs  from
  680.           the  ffiillee  ssttaatt  command in that it takes a file handle
  681.           rather than a file name.  If _a_r_r_a_y_v_a_r is specified, the
  682.           status  information  is  returned in the following ele-
  683.           ments of this array variable: aattiimmee, ccttiimmee,  ddeevv,  ggiidd,
  684.           iinnoo,  mmooddee, mmttiimmee, nnlliinnkk, ssiizzee, uuiidd.  Each element is a
  685.           decimal string with  the  value  of  the  corresponding
  686.           field  from  the  ssttaatt return structure; see the manual
  687.           entry for ssttaatt for  details  on  the  meanings  of  the
  688.           values.   If _a_r_r_a_y_v_a_r is not specified, then the infor-
  689.           mation is returned as a keyed list.   Each  element  of
  690.           the  list  is  itself a list with the status value name
  691.           paired with its  value,  in  alphabetical  order.   For
  692.           example:
  693.  
  694.  
  695.           {atime 683617279} {ctime 683617310} {dev 298}  {gid 50}
  696.           {ino 6317}   {mode 33152}  {mtime 683617310}  {nlink 1}
  697.           {size 924} {uid 200}
  698.  
  699.      ppiippee [[_h_a_n_d_l_e__v_a_r__r _h_a_n_d_l_e__v_a_r__w]
  700.           Create a pipe (see the pipe system call  manual  page).
  701.           If  _h_a_n_d_l_e__v_a_r__r  and  _h_a_n_d_l_e__v_a_r__r are specified, then
  702.           variable _h_a_n_d_l_e__v_a_r__r will contain  the  handle  opened
  703.           for  reading  and  _h_a_n_d_l_e__v_a_r__w will contain the handle
  704.           opened for writing.  If the handle  variables  are  not
  705.           specified,  then a list containing the read followed by
  706.           the write handle is returned as the result of the  com-
  707.           mand.
  708.  
  709.      sseelleecctt _r_e_a_d_h_a_n_d_l_e_s [_w_r_i_t_e_h_a_n_d_l_e_s] [_e_x_c_e_p_t_h_a_n_d_l_e_s] [_t_i_m_e_o_u_t]
  710.           This command allows polling  or  blocking  on  multiple
  711.           files  being ready for for reading, are ready for writ-
  712.           ing,  or  have  an   exceptional   condition   pending.
  713.           _r_e_a_d_h_a_n_d_l_e_s, _w_r_i_t_e_h_a_n_d_l_e_s, _e_x_c_e_p_t_h_a_n_d_l_e_s are each lists
  714.           of file handles (as returned from ooppeenn) to  query.   An
  715.           empty  list  ({}) may be specified if a category is not
  716.           used.
  717.  
  718.           The _r_e_a_d_h_a_n_d_l_e_s files are checked to  set  if  data  is
  719.           available  for reading. The _w_r_i_t_e_h_a_n_d_l_e_s are checked if
  720.  
  721.  
  722.  
  723. Tcl                                                            11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. TclX                 UNKNOWN MANUAL SECTION                  TclX
  731.  
  732.  
  733.  
  734.           they  are  clear  for  writing  The  _e_x_c_e_p_t_h_a_n_d_l_e_s  are
  735.           checked to see if an exceptional condition has occured.
  736.           The write and exception checking is most useful on dev-
  737.           ices,  however, the read checking is also very valuable
  738.           when  communicating  with  multiple  processes  through
  739.           pipes.
  740.  
  741.           _T_i_m_e_o_u_t is a floating point timeout number of  seconds.
  742.           If an empty list is supplied (or the parameter is omit-
  743.           ted), then no timeout is set.  If the  value  is  zero,
  744.           then  the  sseelleecctt  command  functions  as a poll of the
  745.           files.
  746.  
  747.           If the _t_i_m_e_o_u_t period expires with none  of  the  files
  748.           becomming  ready,  then  the  command  returns an empty
  749.           list.  Otherwise the command returns a  list  of  three
  750.           elements,  each of those elements is a list of the file
  751.           handles that are ready in the read, write and exception
  752.           classes.   If none are ready in a class, then that ele-
  753.           ment will be the null list.  For example:
  754.               select {file3 file4 file5} {file6 file7} {} 10.5
  755.  
  756.           could return
  757.              {file3 file4} {file6} {}
  758.           or perhaps
  759.              file3 {} {}
  760.  
  761.  
  762. FFIILLEE SSCCAANNNNIINNGG CCOOMMMMAANNDDSS
  763.      These commands provide a facility to  scan  files,  matching
  764.      lines  of the file against regular expressions and executing
  765.      Tcl code on a match.  With this facility you can use Tcl  to
  766.      do  the  sort of file processing that are traditionally done
  767.      with aawwkk.  And since Tcl's  approach  is  more  declarative,
  768.      some of the scripts that are really hard to write in awk are
  769.      a snap in Tcl.
  770.  
  771.      File scanning in Tcl centers around the concept  of  a  _s_c_a_n
  772.      _c_o_n_t_e_x_t.   A  scan context contains one or more match state-
  773.      ments, which associate regular expressions to scan for  with
  774.      Tcl code to be executed when the expressions are matched.
  775.  
  776.      ssccaannccoonntteexxtt [[_o_p_t_i_o_n]
  777.           This command manages file scan contexts.  A  scan  con-
  778.           text  is  a  collection of regular expressions and com-
  779.           mands to execute when that regular expression matches a
  780.           line  of  the  file.   A context may also have a single
  781.           default match, to be applied against lines that do  not
  782.           match  any  of  the regular expressions.  Multiple scan
  783.           contexts may be defined and the may be reused on multi-
  784.           ple  files.   A scan context is identified by a context
  785.           handle.  The ssccaannccoonntteexxtt command  takes  the  following
  786.  
  787.  
  788.  
  789. Tcl                                                            12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. TclX                 UNKNOWN MANUAL SECTION                  TclX
  797.  
  798.  
  799.  
  800.           forms:
  801.  
  802.      ssccaannccoonntteexxtt ccrreeaattee
  803.           Create a new scan context.  The  ssccaannmmaattcchh  command  is
  804.           used to define patterns in the context.
  805.  
  806.      ssccaannccoonntteexxtt ddeelleettee _c_o_n_t_e_x_t_h_a_n_d_l_e
  807.           Delete the scan context identified by _c_o_n_t_e_x_t_h_a_n_d_l_e and
  808.           free  all  the  match  statements  and compiled regular
  809.           expressions associated with the specified context.
  810.  
  811.      ssccaannffiillee _c_o_n_t_e_x_t_h_a_n_d_l_e _f_i_l_e_h_a_n_d_l_e
  812.           Scan the file specified by _f_i_l_e_h_a_n_d_l_e, starting at  the
  813.           current  file position.  Check all patterns in the scan
  814.           context specified by _c_o_n_t_e_x_t_h_a_n_d_l_e against it,  execut-
  815.           ing   the  match  commands  corresponding  to  patterns
  816.           matched.
  817.  
  818.      ssccaannmmaattcchh [[--nnooccaassee] _c_o_n_t_e_x_t_h_a_n_d_l_e [_r_e_g_e_x_p] _c_o_m_m_a_n_d_s
  819.           Specify Tcl _c_o_m_m_a_n_d_s, to be evaluated  when  _r_e_g_e_x_p  is
  820.           matched  by  a ssccaannffiillee command.  The match is added to
  821.           the scan context specified by  _c_o_n_t_e_x_t_h_a_n_d_l_e.   Several
  822.           match  statements  may be specified for a give context.
  823.           _R_e_g_e_x_p is a regular expression  (see  the  rreeggeexxpp  com-
  824.           mand).   If --nnooccaassee is specified as the first argument,
  825.           the pattern is matched regardless of alphabetic case.
  826.  
  827.           If _r_e_g_e_x_p is not specified, then  a  default  match  is
  828.           specified for the scan context.  The default match will
  829.           be executed when a line of the file does not match  any
  830.           of the specified regular expressions.
  831.  
  832.           The array, mmaattcchhIInnffoo, is available when the Tcl code is
  833.           executed  and contains information about the file being
  834.           scanned.  It is local to the top  level  of  the  match
  835.           command unless declared global at that level.  If it is
  836.           to be used as a  global  it  _m_u_s_t  be  declared  global
  837.           before  ssccaannffiillee  is  called  (since  ssccaannffiillee sets the
  838.           mmaattcchhIInnffoo before the match code is executed,  a  subse-
  839.           quent  gglloobbaall  will  override the local variable).  The
  840.           text  of  the  file  line  that  was  matched   is   in
  841.           mmaattcchhIInnffoo((lliinnee)).   The byte offset into the file of the
  842.           line that was matched  is  in  mmaattcchhIInnffoo((ooffffsseett)).   The
  843.           line  number  of  the  line  that  was  matched  is  in
  844.           mmaattcchhIInnffoo((lliinneennuumm)). This is relative to the first  line
  845.           scanned,  not  the  first  line of the file.  The first
  846.           line is line number one.  The file handle of  the  file
  847.           being scanned is in mmaattcchhIInnffoo((hhaannddllee)).
  848.  
  849.      All ssccaannmmaattcchh patterns that match a line will  be  processed
  850.      in  the order that the specifications were added to the scan
  851.      context.  The remainder  of  the  ssccaannmmaattcchh  pattern-command
  852.  
  853.  
  854.  
  855. Tcl                                                            13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. TclX                 UNKNOWN MANUAL SECTION                  TclX
  863.  
  864.  
  865.  
  866.      pairs  may  be skipped for a file line if a ccoonnttiinnuuee is exe-
  867.      cuted in the match command.  If a rreettuurrnn is executed in  the
  868.      body  of the match command, the ssccaannffiillee command in progress
  869.      returns with the value passed to rreettuurrnn as it's value.
  870.  
  871. MMAATTHH CCOOMMMMAANNDDSS
  872.      These commands make many additonal math functions  available
  873.      in  Tcl, including min, max, trig functions, exponent, loga-
  874.      rithm, square root, and more.  An integer random number gen-
  875.      erator is provided as well.
  876.  
  877.      aaccooss _n_u_m
  878.           Returns the arccosine of _n_u_m.  _n_u_m is in radians.
  879.  
  880.      aassiinn _n_u_m
  881.           Returns the arcsin of _n_u_m.  _n_u_m is in radians.
  882.  
  883.      aattaann _n_u_m
  884.           Returns the arctangent of _n_u_m.  _n_u_m is in radians.
  885.  
  886.      cceeiill _n_u_m
  887.           Returns the smallest integer not less than _n_u_m  (float-
  888.           ing point).
  889.  
  890.      ccooss _n_u_m
  891.           Returns the cosine of _n_u_m.  _n_u_m is in radians.
  892.  
  893.      ccoosshh _n_u_m
  894.           Returns the hyperbolic cosine of _n_u_m.
  895.  
  896.      eexxpp _n_u_m
  897.           Returns _e to the power of _n_u_m.
  898.  
  899.      ffaabbss _n_u_m
  900.           Returns the absolute value of _n_u_m (floating point).
  901.  
  902.      fflloooorr _n_u_m
  903.           Returns  the  largest  integer  not  greater  than  _n_u_m
  904.           (floating point).
  905.  
  906.      ffmmoodd _n_u_m_1 _n_u_m_2
  907.           Returns _n_u_m_1 modulo _n_u_m_2.
  908.  
  909.      mmaaxx _n_u_m_1 _n_u_m_2 [.._n_u_m_N]
  910.           Returns the  argument  that  has  the  highest  numeric
  911.           value.  The  arguments,  _n_u_m_N  may  be  any interger or
  912.           floating point values.
  913.  
  914.      mmiinn _n_u_m_1 _n_u_m_2 [.._n_u_m_N]
  915.           Returns the argument that has the lowest numeric value.
  916.           The  arguments,  _n_u_m_N  may  be any interger or floating
  917.           point values.
  918.  
  919.  
  920.  
  921. Tcl                                                            14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. TclX                 UNKNOWN MANUAL SECTION                  TclX
  929.  
  930.  
  931.  
  932.      lloogg _n_u_m
  933.           Returns the natural logarithm of _n_u_m.
  934.  
  935.      lloogg1100 _n_u_m
  936.           Returns the logarithm base 10 of _n_u_m.
  937.  
  938.      ppooww _n_u_m_1 _n_u_m_2
  939.           Returns _n_u_m_1 to the power of _n_u_m_2.
  940.  
  941.      rraannddoomm lliimmiitt | sseeeedd [_s_e_e_d_v_a_l]
  942.           Generate a pseudorandom integer number greater than  or
  943.           equal  to  zero and less than _l_i_m_i_t.  If sseeeedd is speci-
  944.           fied, then the command resets the random number genera-
  945.           tor  to a starting point derived from the sseeeeddvvaall. This
  946.           allows one to reproduce a random  number  sequence  for
  947.           testing purposes.  If _s_e_e_d_v_a_l is omitted, then the seed
  948.           is set to a value based on current system state and the
  949.           current  time,  providing  a reasonably interesting and
  950.           ever-changing seed.
  951.  
  952.      ssiinn _n_u_m
  953.           Returns the sin of _n_u_m.  _n_u_m is in radians.
  954.  
  955.      ttaann _n_u_m
  956.           Returns the tangent of _n_u_m.  _n_u_m is in radians.
  957.  
  958.      ssiinnhh _n_u_m
  959.           Returns the hyperbolic sin of _n_u_m.
  960.  
  961.      ssqqrrtt _n_u_m
  962.           Returns the square root of _n_u_m.
  963.  
  964.      ttaannhh _n_u_m
  965.           Returns the hyperbolic tangent of _n_u_m.
  966.  
  967. LLIISSTT MMAANNIINNIIPPUULLAATTIIOONN CCOOMMMMAANNDDSS
  968.      Extended Tcl provides two additional list manipulation  com-
  969.      mands.
  970.  
  971.      lleemmppttyy _l_i_s_t
  972.           Determine if the specified list is empty.  If empty,  1
  973.           is returned, otherwise, 0 is returned.  This command is
  974.           an alternative to comparing a list to an empty string.
  975.  
  976.      llvvaarrppoopp _v_a_r [_i_n_d_e_x [_s_t_r_i_n_g]]
  977.           The llvvaarrppoopp command pops (deletes) the element  indexed
  978.           by  _i_n_d_e_x  from the list in the variable _v_a_r.  If _i_n_d_e_x
  979.           is omitted, then 0 is assumed.  If  _s_t_r_i_n_g,  is  speci-
  980.           fied,  then  the deleted element is replaced by _s_t_r_i_n_g.
  981.           The replaced or  deleted  element  is  returned.   Thus
  982.           ``lvarpop  argv  0'' returns the first element and sets
  983.           argv to contain the remainder of the string.
  984.  
  985.  
  986.  
  987. Tcl                                                            15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. TclX                 UNKNOWN MANUAL SECTION                  TclX
  995.  
  996.  
  997.  
  998. KKEEYYEEDD LLIISSTTSS
  999.      Extended Tcl defines a special type of list referred  to  as
  1000.      _k_e_y_e_d  _l_i_s_t_s.   These  lists provided a structured data type
  1001.      built upon standard Tcl lists.  This provides a  functional-
  1002.      ity  similar  to  ssttrruucctts  in the C programming language.  A
  1003.      keyed list is a list in which each  element  is  a  key  and
  1004.      value  pair  field.  These elements are actually lists them-
  1005.      selves, were the key is the first element of the  list,  and
  1006.      the value is the second.  The key-value pairs are refered to
  1007.      as _f_i_e_l_d_s.  This is an example of a keyed list:
  1008.  
  1009.               {{NAME {Frank Zappa}} {JOB {musician and composer}}
  1010.  
  1011.      By convention, `.' is a field name separator, allowing nest-
  1012.      ing  of  fields,  even  though keyed list are only one level
  1013.      deep.  Currently none of the commands explictly function  on
  1014.      nested field names, but they may in a future release, so `.'
  1015.      should not be used for other than a  field  separator  in  a
  1016.      name.  For example:
  1017.  
  1018.               {{ID 106} {NAME.FIRST Frank} {NAME.LAST Zappa}}
  1019.  
  1020.      All key list functions take the name of  the  variable  con-
  1021.      taining the keyed list as an argument (i.e. passed by refer-
  1022.      ence) rather than the value.
  1023.  
  1024.      kkeeyyllddeell _l_i_s_t_v_a_r _k_e_y
  1025.           Delete the field specified by _k_e_y from the  keyed  list
  1026.           in the variable _l_i_s_t_v_a_r.  This removes both the key and
  1027.           the value from the keyed list.
  1028.  
  1029.      kkeeyyllggeett _l_i_s_t_v_a_r _k_e_y [_r_e_t_v_a_r | {}]
  1030.           Return the value associated with the _k_e_y out  of  keyed
  1031.           list  in the variable _l_i_s_t_v_a_r.  If _r_e_t_v_a_r is not speci-
  1032.           fied, then the value will be returned as the result  of
  1033.           the command.  If _k_e_y is not found in the list, an error
  1034.           will result.  If _r_e_t_v_a_r is specified and _k_e_y is in  the
  1035.           list, then the value is returned in the variable _r_e_t_v_a_r
  1036.           and the command returns one. If _k_e_y is not in the list,
  1037.           the command will return 00 and _r_e_t_v_a_r will be unchanged.
  1038.           If {{}}  is  specified  for  _r_e_t_v_a_r,  the  value  is  not
  1039.           returned, only the presence of the key is determined.
  1040.  
  1041.      kkeeyyllsseett _l_i_s_t_v_a_r _k_e_y _v_a_l_u_e
  1042.           Set the value associated with the _k_e_y in the keyed list
  1043.           in the variable _l_i_s_t_v_a_r  to _v_a_l_u_e.  If listvar does not
  1044.           exists, it is created.  If _k_e_y is not currently in  the
  1045.           list,  it  will  be added.  If it already exists, _v_a_l_u_e
  1046.           overrides the existing value.
  1047.  
  1048. SSTTRRIINNGG AANNDD CCHHAARRAACCTTEERR MMAANNIIPPUULLAATTIIOONN CCOOMMMMAANNDDSS
  1049.      The commands provide additional  functionality  to  classify
  1050.  
  1051.  
  1052.  
  1053. Tcl                                                            16
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. TclX                 UNKNOWN MANUAL SECTION                  TclX
  1061.  
  1062.  
  1063.  
  1064.      characters, convert characters between character and numeric
  1065.      values, and index into a string, determine the length  of  a
  1066.      string,  extract  a range of character from a string, repli-
  1067.      cate a string a number of times, and transliterate a  string
  1068.      (similar to the _t_r command).
  1069.  
  1070.      cciinnddeexx _s_t_r_i_n_g _i_n_d_e_x
  1071.           Returns the character indexed  by  _i_n_d_e_x  (zero  based)
  1072.           from _s_t_r_i_n_g.  This command is a shortcut for:
  1073.               ssttrriinngg iinnddeexx _s_t_r_i_n_g _i_n_d_e_x
  1074.  
  1075.      cclleennggtthh _s_t_r_i_n_g
  1076.           Returns the length of _s_t_r_i_n_g in characters.  This  com-
  1077.           mand is a shortcut for:
  1078.               ssttrriinngg lleennggtthh _s_t_r_i_n_g
  1079.  
  1080.      ccrraannggee _s_t_r_i_n_g _f_i_r_s_t _l_a_s_t
  1081.           Returns a range of characters from _s_t_r_i_n_g  starting  at
  1082.           _f_i_r_s_t (zero-based) until _l_a_s_t.  The special keyword eenndd
  1083.           may  be  specified  for  _l_a_s_t  to  indicate  that   the
  1084.           remainder  of the string is to be extracted.  This com-
  1085.           mand is a short cut for:
  1086.               ssttrriinngg rraannggee _s_t_r_i_n_g _f_i_r_s_t _l_a_s_t
  1087.  
  1088.      ccssuubbssttrr _s_t_r_i_n_g _f_i_r_s_t _l_e_n_g_t_h
  1089.           Returns a range of characters from _s_t_r_i_n_g  starting  at
  1090.           _f_i_r_s_t  (zero-based) for _l_e_n_g_t_h characters.  The special
  1091.           keyword eenndd may be specified  for  _l_e_n_g_t_h  to  indicate
  1092.           that  the  remainder  of the string is to be extracted.
  1093.           This command is a short cut for:
  1094.               ssttrriinngg rraannggee _s_t_r_i_n_g _f_i_r_s_t [eexxpprr _l_e_n_g_t_h--11]
  1095.  
  1096.      ccttyyppee _c_l_a_s_s _s_t_r_i_n_g
  1097.           Determine if all characters in _s_t_r_i_n_g  are  in  of  the
  1098.           specified  _c_l_a_s_s.   Returns  11 if they are all of _c_l_a_s_s
  1099.           and 00 if they are not or if the string  is  null.  This
  1100.           command  also  provides  another method (besides ffoorrmmaatt
  1101.           and ssccaann) of converting between an ASCII character  and
  1102.           its  numeric  value.   The following ccttyyppee commands are
  1103.           available.
  1104.  
  1105.           ccttyyppee aallnnuumm _s_t_r_i_n_g
  1106.                Tests  that  all  characters  are  alphabetic   or
  1107.                numeric  characters  as  defined  by the character
  1108.                set.
  1109.  
  1110.           ccttyyppee aallpphhaa _s_t_r_i_n_g
  1111.                Tests that all characters are  alphabetic  charac-
  1112.                ters as defined by the character set.
  1113.  
  1114.           ccttyyppee aasscciiii _s_t_r_i_n_g
  1115.                Tests that all characters are an  ASCII  character
  1116.  
  1117.  
  1118.  
  1119. Tcl                                                            17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. TclX                 UNKNOWN MANUAL SECTION                  TclX
  1127.  
  1128.  
  1129.  
  1130.                (a non-negative number less than 0200).
  1131.  
  1132.           ccttyyppee cchhaarr _n_u_m_b_e_r
  1133.                Converts the numeric value, _s_t_r_i_n_g,  to  an  ASCII
  1134.                character.   Number must be in the range 0 through
  1135.                255.
  1136.  
  1137.           ccttyyppee ccnnttrrll _s_t_r_i_n_g
  1138.                Tests that all characters  are  ``control  charac-
  1139.                ters'' as defined by the character set.
  1140.  
  1141.           ccttyyppee ddiiggiitt _s_t_r_i_n_g
  1142.                Tests  that  all  characters  are  valid   decimal
  1143.                digits, i.e. 0 through 9.
  1144.  
  1145.           ccttyyppee ggrraapphh _s_t_r_i_n_g
  1146.                Tests that all characters within are any character
  1147.                for  which  _c_t_y_p_e  _p_r_i_n_t is true, except for space
  1148.                characters.
  1149.  
  1150.           ccttyyppee lloowweerr _s_t_r_i_n_g
  1151.                Tests that all characters are lowercase letters as
  1152.                defined by the character set.
  1153.  
  1154.           ccttyyppee oorrdd _c_h_a_r_a_c_t_e_r
  1155.                Convert  a  character  into  its  decimal  numeric
  1156.                value.  The string must be one character long.
  1157.  
  1158.           ccttyyppee ssppaaccee _s_t_r_i_n_g
  1159.                Tests that all  characters  are  either  a  space,
  1160.                horizontal-tab,    carriage    return,    newline,
  1161.                vertical-tab, or form-feed.
  1162.  
  1163.           ccttyyppee pprriinntt _s_t_r_i_n_g
  1164.                Tests that all characters are a space or any char-
  1165.                acter for which _c_t_y_p_e _a_l_n_u_m or _c_t_y_p_e _p_u_n_c_t is true
  1166.                or other ``printing character'' as defined by  the
  1167.                character set.
  1168.  
  1169.           ccttyyppee ppuunncctt _s_t_r_i_n_g
  1170.                Tests that all characters are made up  of  any  of
  1171.                the  characters  other  than  the  ones  for which
  1172.                aallnnuumm, ccnnttrrll, or ssppaaccee is true.
  1173.  
  1174.           ccttyyppee uuppppeerr _s_t_r_i_n_g
  1175.                Tests that all characters are uppercase letters as
  1176.                defined by the character set.
  1177.  
  1178.           ccttyyppee xxddiiggiitt _s_t_r_i_n_g
  1179.                Tests that all characters  are  valid  hexadecimal
  1180.                digits,  that  is  _0  through  _9, a through _f or _A
  1181.                through _F.
  1182.  
  1183.  
  1184.  
  1185. Tcl                                                            18
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. TclX                 UNKNOWN MANUAL SECTION                  TclX
  1193.  
  1194.  
  1195.  
  1196.      rreepplliiccaattee _s_t_r_i_n_g _c_o_u_n_t
  1197.           Returns _s_t_r_i_n_g replicated _c_o_u_n_t times.
  1198.  
  1199.      ttrraannsslliitt _i_n_r_a_n_g_e _o_u_t_r_a_n_g_e _s_t_r_i_n_g
  1200.           Translate characters in _s_t_r_i_n_g matching  characters  in
  1201.           _i_n_r_a_n_g_e  to  the  corresponding  character in _o_u_t_r_a_n_g_e.
  1202.           _I_n_r_a_n_g_e and _o_u_t_r_a_n_g_e may be list  of  characters  or  a
  1203.           range in the form `A-M'.
  1204.               Example:
  1205.                   translit a-z A-Z foobar
  1206.               returns
  1207.                   FOOBAR
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251. Tcl                                                            19
  1252.  
  1253.  
  1254.  
  1255.